import requests  
  
# 定义你的JSON数据  
data = {
    "id":"123",
    "“version":"1.0",
    "params":{
        "D":{
            "value":1200
        },
        "L":{
            "value":666
        },
        "J":{
            "value":777
        }
    }

}
# 设置请求头  
headers = {  
    'Content-Type': 'application/json',  # 告诉服务器你发送的是JSON数据  
    'Token':'version=2018-10-31&res=products%2F1F6EgBE3JN%2Fdevices%2Fsmp&et=1717679150&method=md5&sign=Fyaw%2F5Joi9jCiRyxMhcnBg%3D%3D'

}  
  
# 设置请求的URL  
url = 'https://open.iot.10086.cn/fuse/http/device/thing/property/post?topic=$sys/1F6EgBE3JN/smp/thing/property/post&protocol=http'  
  
# 发送POST请求，并附带JSON数据和请求头  
response = requests.post(url, json=data, headers=headers)  
  
# 检查响应状态码  
if response.status_code == 200:  
    # 请求成功，处理响应内容  
    print(response.json())  # 将响应内容解析为JSON  
else:  
    # 请求失败，打印错误信息  
    print(f"Request failed with status code {response.status_code}")  
    print(response.text)  # 打印响应内容，可能包含错误信息